package org.xteam.pascal.parser.test;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTree;

import org.xteam.parser.runtime.AstNode;

public class AstTreeViewer extends JFrame {

	private JTree tree;
	private AstTreeModel model;

	public AstTreeViewer(AstNode root) {
		setTitle("Ast Tree Viewer");
		setSize(500, 500);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		model = new AstTreeModel(root);
		tree = new JTree(model);
		tree.setShowsRootHandles(true);
		JScrollPane scroll = new JScrollPane(tree);
		getContentPane().add(scroll);
	}
	
}
